import { ComponentPropsWithoutRef } from "react";
import { IconType } from "react-icons";
type ButtonProps = {
    icon?: IconType
} & ComponentPropsWithoutRef<"button">
export default function Button({
    children,
    icon: Icon,
    className,
    ...props
}:ButtonProps) {
    return (
        <button
            {...props}
            className={`inline-flex items-center border border-gray-300 rounded-md  px-4 py-2 text-sm font-medium hover:bg-gray-800 ${className}`}
        >
            {Icon && <Icon className={`text-lg ${children ? 'mr-1' : ''}`}/>}
            {children}
        </button>
    )
} 